# coding: utf-8
from PySide6.QtCore import Signal
from qfluentwidgets import FluentIcon as FIF, NavigationItemPosition, MSFluentWindow

from components import NavigationInterface, NavigationButton
from .theme_interface import ThemeInterface
from common import SingleIcon


class SettingWindow(NavigationInterface):
    quitSignal = Signal()

    def __init__(self, parent=None):
        super().__init__(parent)
        self.settingInterface = ThemeInterface(self)
        self.quitBtn = NavigationButton(FIF.EMBED, '退出', self)
        self.__initWidgets()

    def __initWidgets(self):
        self.quitBtn.setCheckable(False)
        self.quitBtn.clicked.connect(self.quitSignal)
        # 初始化导航栏
        self.addSubInterface(self.settingInterface, SingleIcon.THEME, '主题设置', position=NavigationItemPosition.TOP)
        self.navigationBar.addWidget('quit', self.quitBtn, position=NavigationItemPosition.BOTTOM)
